const axios = require('axios');
const FormData = require('form-data');
axios.defaults.withCredentials = true

let mydata = new FormData();
mydata.append('Cookie', "token=it_token:1656853695.91139584578");
mydata.append('Accept', "application/json, text/plain, */*");
mydata.append('Content-Type', "application/json;charset=UTF-8");

axios({
    method: 'POST',
    // url: 'http://tcoa.17usoft.com/platform/EmployeeBase/WorkExperienceListBind',
    url: 'http://tcoa.17usoft.com/td/tag-web/add-all-tag',
    data:{
        professionalTagIds: '',
        tagNames: '测试标签',
        userId: 'bnZGeVMrejlkTmxMdy94cElFRG1MZz08'
    },
    headers: {
        // 'Accept': "*/*",
        // 'Accept-Encoding': "gzip, deflate",
        // 'Accept-Language': "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ko-KR;q=0.6,ko;q=0.5,ja-JP;q=0.4,ja;q=0.3",
        // "Cache-Control": "no-cache",
        // "Connection": "keep-alive",
        // "Content-Length": "0",
        // "Cookie": "TCOA_Global_ManageUnitCookie=UlZYQ2J0WXhPYWtwNlErdWhWbnBBUT090; TCOA_Global_MainManageUnitCookie=UlZYQ2J0WXhPYWtwNlErdWhWbnBBUT090; ASP.NET_SessionId=4kwmwntwt3ycxb5zodovuiq3; TCOA_Global_Cookie=mpSwCPHdX/8bAy7Fj1SD2VY7JDffvwwiaOT4AwkbGR7T5bkaKECUDB3rzIO9iHrbrQ0RlxfhxpmvaEPUmfsAHKC6y0tk/5v7gOEIKfU2tbg=; __tctmu=102596417.0.0; __tctmz=102596417.1667791030291.90.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); longKey=1658822012412763; __tctrack=0; oastate=69053df640224223a2f55fb23bf63a7c; __tctmc=102596417.169733540; __tctmd=102596417.737325; access_token=9bca8d757215ab1b3da96046731288c8; user_info=lqp6W38zM6zcNhoPfRXd51IKbrgIGFyDqqVAhwm2aBElwr56D5AQDcfgxWkUyUpcacadDDDxTwCW7MKycVL+Ji4rLhSZcq4vn1vpGlyTVyRjKCrygzBv3r+k+bxfmVNApNW27S5T2RWbHQwBrhj3YiE0OTSe8x4+u+nHn3d3VMc1MJRGGR03DIhU8vIDoBai1RHMunKcl4kn57WDp0Vx+Yap1z+m9clpve5+0qo6lDp4rrTs/G5ue2AERfwlnbtIJwFdUR+at9CeSSTsraPrRdSoWdcjwv3gxqjvbSTaGFoJslohiqiBJBL47TmW2dXaDbt+JnBCmdkzGzySLlOYuc9NSBqLPPDVaRgNnzwLL8eXrYWyM6PNJxibZNmOgZrlPDp5bJNDRPMr8ZML5YeW3Vdw3WM7BS4WwrViKZDKoTDF3uGXPhZiqNMyuimXPzADYJDgKa+eSyoBvw/MeIZGJ1Tt/JNkT+5Vj0hkVk+0TpWtEk1Y4u/MO6xWcV0H6wLR/iTEFdK/fqcdVk4LyUe+edibelec5tgIAbBYITmb3gqeiCfOCjH4QpeZgol3SzQi3XR1VKF5SJTBZM0SMiHNTCETZ+YDKT/yThwwqsfVNXF3hV0tyj6uOjGwUYdy1eU7xdJEQBGUFr9+lDmNx2RnnVx8HUT7oLOeuAL/fRMzxMA+joa6LOb2r91OFrGQqo1Ksla0pkYsm7+2Ii5JZCyTBq9DHlC1gWJgPJZ0sAh8XcIPrSjrbPTiEaLiDJHw0xohM+amHwT+ZF9edqRTw9jC7/Pyd+i9exE+F78q5ysXVVlzdPG07rYw9i8E/1lrC0sijp5Mgf+kf8kaOOQJ3PJ4FSdZj9kzwkvk/6C1iowJqhualnz2NTOK5ajntl/2aNXzsKGmtmN+jRWGujw+J8yN9A==; __tctma=102596417.1658822012412763.1658822012453.1667873088112.1667901907339.92; __tctmb=102596417.1281342276441204.1667901907339.1667901907339.1; route=829f32cb22cd5c7999ca44345bd0f745",
        // 'DNT': '1',
        // 'Host': ' tcoa.17usoft.com',
        // 'Origin': 'http://tcoa.17usoft.com',
        // 'Pragma': 'no-cache',
        // 'Referer': 'http://tcoa.17usoft.com/platform/EmployeeBase/Index?ParentID=01&MenuID=0101&type=apply',
        // 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36',
        // 'X-Requested-With': 'XMLHttpRequest'
    } // 这个地方大坑，headers自己写multipart/form-data会出问题[恶心死了]，必须写这个

}).then(res => {
    console.log('save', res.data)
}).catch(err => {
    console.log(err)
})